<template>
	<view>


		<view class="big-box" v-for="(item,index) in list">

			<view class="box">

				<view class="qian">
					<text style="font-size: 15px;">¥</text><text>{{item.couponPrice}}</text>
					<view class="mj">
						<text>满</text><text>{{item.couponConditions}}</text><text>可用</text>
					</view>
				</view>

			</view>

			<view class="box2">

				<view class="mj">
					<text>{{item.dtitle}}</text>
				</view>

				<view class="mj2">
					<text>领取7天内有效</text>
					<view class="text" @click="dj(index)"><text>立即领取</text></view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
			list:[],
			}
		},
		methods: {
			dj(index){
				uni.navigateTo({
					url: './lingjuan?'+"&id="+this.list[index].id
				});
			}
		},
		onLoad() {
			let that = this
			uni.request({
				url: "https://openapi.dataoke.com/api/goods/get-goods-list?version=v1.2.4&appKey=612bcfe884763&pageId=1&pageSize=100&sort=0&sign=195f438dc203278dde0ca425d6af807f",
				success(res) {
					console.log(res)
					that.list = res.data.data.list
					// that.list = that.list.slice(0, 30)
					console.log(that.list)
				},
			})
		}
	}
</script>

<style lang="scss">
	.big-box {
		display: flex;
		background-color: #ff1e52;
		// border: 1px solid red;
		width: 95%;
		height: 100px;
		margin-right: 10px;
		margin-left: 10px;
		margin-top: 5px;

		.box {
			border-right: 2px solid white;
			width: 38%;
			height: 100px;

			.qian {
				width: 100%;
				color: white;
				padding: 15%;
				padding-top: 20px;
				font-size: 25px;

				.mj {
					margin-top: 6px;
					font-size: 10px;
				}

			}
		}

		.box2 {
			width: 100%;
			// border: 1px solid blue;

			.mj {
				// width: 100%;
				color: white;
				// height: 40px;
				margin-top: 20px;
				margin-left: 10px;
				// border: 1px solid black;
			}

			.mj2 {
				
				color: white;
				display: flex;
				justify-content: space-between;
				// border: 1px solid black;
				margin-top: 15px;
				margin-left: 10px;

				.text {
					// width: 80px;
					border: 1px solid white;
					border-radius: 45px;
					// padding-right: 20px;
				}
			}
		}
	}
</style>
